package com.leiyuee.flink.tools.constants;

import org.apache.flink.table.data.StringData;
import org.apache.flink.table.data.TimestampData;

import java.util.function.Function;

public class DataFunc {

    /** String to StringData */
    Function<String, StringData> TO_STRING_DATA = StringData::fromString;

    /** StringData to String */
    Function<StringData, String> TO_STRING = String::valueOf;

    Function<Long, TimestampData> TO_TIMESTAMP_DATA = (timestamp) -> timestamp ==  null ? null : TimestampData.fromEpochMillis(timestamp);

}
